package qq

import (
	"github.com/Mrs4s/go-cqhttp/cache"
	"github.com/Mrs4s/go-cqhttp/model"
)

/* Sabi 撒币技能，针对在册用户随机抽取5为用户撒币 */
func Sabi(userID, coins int64) (flag int64, user []int64) {
	my_coins := model.GetUserCoinsByUserID(userID)
	if my_coins < coins {
		flag = 1 // 自己余额不足
		return
	}

	flag = 2 // 撒币成功
	// TODO 未完成
	model.SetUserCoinsByUserID(userID, -coins, "sabi技能消耗")
	cache.GetRedis().AddFiveLimitLog(userID)
	// model.getu
	// 抢劫成功
	model.SetUserCoinsByUserID(userID, coins, "抢劫收益")
	return
}
